package com.sai.tool;
import android.graphics.drawable.DrawableWrapper;
import android.graphics.DrawFilter;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.graphics.Canvas;
import android.graphics.PaintFlagsDrawFilter;

public class PixelDrawable extends DrawableWrapper
{ 
	private static final DrawFilter DRAW_FILTER = 
	new PaintFlagsDrawFilter(Paint.FILTER_BITMAP_FLAG, 0); 

	public PixelDrawable(Drawable wrapped)
	{ 
		super(wrapped); 
	} 

	@Override 
	public void draw(Canvas canvas)
	{ 
		DrawFilter oldDrawFilter = canvas.getDrawFilter(); 
		canvas.setDrawFilter(DRAW_FILTER); 
		super.draw(canvas); 
		canvas.setDrawFilter(oldDrawFilter); 
	}  
}
